package com.demo.resourcecode.validator;

import javax.validation.constraints.Max;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Validated
public class ValidController2 {

	public ValidController2() {
		System.out.println("");
	}

	@GetMapping("/valid2/{age}")
	public String valid2(@PathVariable("age") @Max(value=13, message="不能大于13") int age){
        return "valid";
	}

}
